package cn.school.test;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.GradeDao;
import cn.school.dao.SubjectDao;
import cn.school.util.MyBatisUtil;
import cn.shcool.entity.Grade;
import cn.shcool.entity.Student;
import cn.shcool.entity.Subject;

public class GradeTest {

	public static void main(String[] args) {

		SqlSession s = MyBatisUtil.get();

		GradeDao sdao = s.getMapper(GradeDao.class);
		Grade g = sdao.get(2);
		// System.out.println("年级的信息：" + g);
		// System.out.println("这个年级的 信息如下：");
		// for (Student stu : g.getStus())
		// System.out.println(stu);
		// MyBatisUtil.close(s);
		System.out.println("年级的信息：" + g);
		System.out.println("这个年级的课程信息如下：");
		for (Subject stu : g.getSb())
			System.out.println(stu);
		MyBatisUtil.close(s);
	}
}